<?php

$ingin = array('P' => 'Memberi tumpangan', 'U' => 'Menumpang');
$socmed = array('1' => 'Facebook', '2' => 'Twitter');


function generate_input_z($type='', $array=array(), $name='', $sel='') {
    if ($type == 'radio') {
        foreach ($array as $key => $val) {
            echo '<label class="radio">';
            echo '<input data-toggle="radio" type="' . $type . '" name="' . $name . '" value="' . $key . '"/>' . $val . '&nbsp;';
            echo '</label>';
        }
    } else {
        foreach ($array as $key => $val) {
            echo '<input type="' . $type . '" name="' . $key . '" value="' . $key . '"/>' . $val . '&nbsp;';
        }
    }
}
?>
<div class="page">
    <script type="text/javascript" src="<?php echo base_url();?>assets/js/gmaps/jquery.js"></script>
    
    
    <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;sensor=true&amp;key=AIzaSyCtENSPqFdcV0dHRN93HwyDwubNtDRn6hc" type="text/javascript"></script>
    <script type="text/javascript" src="<?php echo base_url();?>assets/js/gmaps/gps.jquery.js"></script>
    <style>
        #map {
            width: 300px;
            height: 300px;
        }
    </style>
    <script type="text/javascript">
    $(function() {
    $("#map").googleMap().load();
    });
    </script> 
    <div class="container">
        <div class="span10 offset1" style="margin-top:20px;" id="wrap">
            <div class="container-fluid">
                <div class="row-fluid">
                    <div class="span8">
<script src="http://maps.googleapis.com/maps/api/js?sensor=false&amp;libraries=places"></script>
                    <script src="http://ubilabs.github.io/geocomplete/jquery.geocomplete.js"></script>

     <script>
      $(function(){
        
        $("#geocomplete").geocomplete()
          .bind("geocode:result", function(event, result){
            $.log("Result: " + result.formatted_address);
          })
          .bind("geocode:error", function(event, status){
            $.log("ERROR: " + status);
          })
          .bind("geocode:multiple", function(event, results){
            $.log("Multiple: " + results.length + " results found");
          });
        
        $("#find").click(function(){
          $("#geocomplete").trigger("geocode");
        });
        
        
        $("#examples a").click(function(){
          $("#geocomplete").val($(this).text()).trigger("geocode");
          return false;
        });
        
      });
     </script>
                        <h4 class="span10"><strong>MEMBUAT PERJALANAN</strong></h4>
<form name="go" method="POST" action="<?php echo site_url('perjalanan/buat');?>">  
    <div class="row">          
    <div class="span3"> Kamu ingin:  </div>
    <div class="span6">        
        <?php generate_input_z('radio',$ingin,'status'); ?>
    </div>
    </div>
    <div class="row">
    <div class="span3">Dari</div>
    <div class="span6"><input class="span3" id="" type="text" name="source_label" value="Depok" /></div>
    </div>
    <div class="row">
    <div class="span3">Ke</div>    
    <div class="span6"><input class="span3" id="geocomplete" type="text" name="destination_label" value="Lenteng Agung" /></div>
    </div>
    <div class="row">
    <div class="span3 offset6"><input name="submit" id="getdirections" type="submit" value="Get Directions" /></div>    
    
    </div>
    <div class="row">
    <div class="span3">Via </div>   
    <div class="span6"><input class="span3" type="text" name="via" value="Pondok Cina, Universitas Indonesia" /></div>
    </div>
    <div class="row">
    <div class="span3">Jam</div>   
    <div class="span6"><input class="span3" type="text" name="departTime" type="datetime" value="2013-02-30 13:30" /></div>
    </div>
    <div class="row">
    <div class="span3">Harga </div>   
    <div class="span6"><input class="span3" type="text" name="priceInRupiah" value="10000" /></div>
    </div>
    <div class="row">
    <div class="span3">Catatan </div>   
    <div class="span6"><textarea rows="3" class="span1" name="notes" placeholder="masukkan catatan"></textarea></div>
    </div>
    <div class="row">
    <div class="span6">
    <input type="submit" class="btn btn-primary btn-large span4 offset6" value="POST"/>
    </div>
    </div><br/>
</form>   
                    </div>
                    <div class="span4"><div id="map" class="map"></div></div>
                </div>
            </div>
 
</div>
</div>
</div>
<!-- <h4>MEMBUAT PERJALANAN</h4>
<form name="go" method="POST" action="<?php echo site_url('perjalanan/buat');?>">  
    <div class="row">          
    <div class="span2"> Kamu ingin:  </div>
    <div class="span4">
        
        <?php generate_input_z('radio',$ingin,'status'); ?>

    </div>
    </div>
    <div class="row">
    <div class="span2">Dari</div>
    <div class="span4"><input class="span3" id="start" type="text" name="source_label" value="Depok" /></div>
    </div>
    <div class="row">
    <div class="span2">Ke</div>    
    <div class="span4"><input class="span3" id="end" type="text" name="destination_label" value="Lenteng Agung" /></div>
    </div>
    <div class="row">
    <div class="span2"><input name="submit" id="getdirections" type="submit" value="Get Directions" /></div>    
    
    </div>
    <div class="row">
    <div class="span2">Via </div>   
    <div class="span4"><input class="span3" type="text" name="via" value="Pondok Cina, Universitas Indonesia" /></div>
    </div>
    <div class="row">
    <div class="span2">Jam</div>   
    <div class="span4"><input class="span3" type="text" name="departTime" type="datetime" value="2013-02-30 13:30" /></div>
    </div>
    <div class="row">
    <div class="span2">Harga </div>   
    <div class="span4"><input class="span3" type="text" name="priceInRupiah" value="10000" /></div>
    </div>
    <div class="row">
    <div class="span2">Catatan </div>   
    <div class="span3"><textarea rows="3" class="span1" name="notes" placeholder="masukkan catatan"></textarea></div>
    </div>
    <div class="row">
    <div class="span6">
    <input type="submit" class="btn btn-primary btn-large span2 offset6" value="POST"/>
    </div>
    </div>
</form>    
     <form action="directions.php" method="post"> -->
        <!-- <p><b>From: </b><input id="end" type="text" value="" placeholder="tegal, jawa tengah" />
        <b>To: </b><input id="start" type="text" /></p> -->
        
    <!-- </form> 
    <div id="map"></div> -->
        